export function formatterMenuTree(nodes: [], key: string, parentkey: string): [] {//menuParentFolderId
  const nodeMap = new Map(nodes.map(item => [item[key], item]))
  let datatree: [] = [];
  nodeMap.forEach(item => {
    if (!item[parentkey]) {
      datatree.push(item);
    } else {
      // 找到父节点
      const parentNode: any = nodeMap.get(item[parentkey]);
      if (parentNode) {
        if (!parentNode.children) {
          parentNode.children = [];
        }
        parentNode.children.push(item);
      }
    }
  })
  return datatree;
}